/// 
/// Author: Jeff Liu
/// Date: 2021-07-13 14:29:38
/// LastEditTime: 2023-05-19 13:51:22
/// LastEditors: Jeff Liu
/// Description: 
/// FilePath: /HCCBJ/src/HCC/DocRepository/LatestDocs.cls
/// Jeff.liu@intersytems.com
/// 
/// 共享文档存储表
/// 需要增加Unique Key在DocId上。暂时不加，等Jeff修改文档注册服务
Class HCC.DocRepository.LatestDocs Extends (%Persistent, %XML.Adaptor) [ SqlTableName = LatestDocs ]
{

Parameter XMLNamespace = "urn:hl7-org:v3";

/// 消息创建时间
Property MsgCreatTime As %TimeStamp;

/// 发送系统标识
Property SenderId As %String;

/// 文档编号
Property DocId As %String [ Required ];

/// 文档唯一编号
Index UKDocId On DocId [ Unique ];

/// 文档类型代码
Property DocCode As %String [ Required ];

/// 文档类型名称
Property DocName As %String [ Required ];

/// 文档生成日期时间
Property DocCreatTime As %TimeStamp;

/// 文档版本号
Property VersionNumber As %Integer [ InitialExpression = 1 ];

/// 文档原始内容
Property Content As %String(MAXLEN = "");

// Property PatId As %String;

/// 患者唯一标识
/// 住院号标识
Property PatInHosCode As %String;

// Property PatInHosCount As %Integer [ InitialExpression = 1 ];

/// 住院次数
/// 门诊号标识
Property PatOutHosCode As %String;

/// 患者就诊日期起始时间
Property PatEffectiveLowTime As %TimeStamp;

/// 患者就诊日期截至时间
Property PatEffectiveHighTime As %TimeStamp;

// Property PatCardId As %String;

// Property PatName As %String;

/// 身份证号
/// 患者姓名
/// 文档提供的医院标识
Property ProHosCode As %String;

/// 文档提供的医院名称
Property ProHosName As %String;

/// 科室代码
Property DeptCode As %String;

/// 文档创建者编号
Property DocUserCode As %String;

/// 文档创建者姓名
Property DocUserName As %String;

/// 文档保管的医院标识
Property RepHosCode As %String;

/// 文档保管的医院名称
Property RepHosName As %String;

/// 数据存储时间
Property AddDate As %TimeStamp;

/// 病人 one
Relationship Patient As HCC.DocRepository.Patient(XMLPROJECTION = "element") [ Cardinality = one, Inverse = DocL ];


}
